package cn.com.coding.app;

import cn.com.coding.common.lang.ResT;
import cn.com.coding.common.utils.ChainMapReduce;
import cn.com.coding.common.utils.OneSort;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 一键大数据
 *
 * @author mxz
 * @email codingce@gmail.com
 * @date 2022-03-05 14:01:22
 */
@RestController
@RequestMapping("cat/hadoop")
public class HadoopController extends BaseController {

    /**
     * 数据清洗存储
     */
    @RequestMapping("/clear")
    public ResT dataClear(@RequestParam Map<String, Object> params) {
        if (ChainMapReduce.fixHadoop()) {
            return ResT.ok();
        }
        return ResT.error();
    }

    /**
     * 数据排序
     */
    @RequestMapping("/sort")
    public ResT dataSort(@RequestParam Map<String, Object> params) {
        if (OneSort.dataSort()) {
            return ResT.ok();
        }
        return ResT.error();
    }

    /**
     * 数据展示
     */
    @RequestMapping("/show")
    public ResT showData(@RequestParam Map<String, Object> params) {
        if (OneSort.dataSort()) {
            return ResT.ok();
        }
        return ResT.error();
    }

}
